<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2" />
    <g:set var="entityName" value="${message(code: 'company.label', default: 'Company')}" />
    <title>公司</title>
</head>

<body>
    <div class="main-body">
        <div class="page-wrapper">
            <!-- Page-header start -->
            <div class="page-header">
                <div class="page-header-title">
                    <h4>所有公司</h4>
                </div>

                <div class="page-header-breadcrumb">
                    <ul class="breadcrumb-title">
                        <li class="breadcrumb-item">
                            <a href="/salesDashboard/index">
                                <i class="icofont icofont-home"></i>
                            </a>
                        </li>
                        <li class="breadcrumb-item"><a href="#!">所有公司</a>
                        </li>
                    </ul>
                </div>
            </div>
            <!-- Page-header end -->
            <!-- Page-body start -->
            <div class="page-body">
                <!-- Hover table card start -->
                <div class="card">
                    <div class="card-header">
                        <h5>所有公司</h5>

                        <div class="card-header-right">
                            %{-- <g:link action="create"><i class="ion-plus"></i> 新增</g:link> --}%
                        </div>
                    </div>

                    <div class="card-block dt-responsive">

                        <div class="table-responsive">
                            <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
%{--
                                <g:form method="POST" action="searchCompany">
                                    <div class="row m-0">
                                        <div class="col-md-8 p-l-0">
                                            <div id="order-table_filter" class="dataTables_filter text-left">
                                                <label>搜索
                                                    <input type="text" class="form-control" placeholder="公司" name="name" id="name" value="${params?.name}">
                                                    <input type="text" class="form-control" placeholder="代码" name="code" id="code" value="${params?.code}">
                                                    <input type="text" class="form-control" placeholder="行业" name="industry" id="industry" value="${params?.industry}">
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-4 p-r-0 dt-buttons text-right">
                                            <button class="btn btn-success btn-mini" type="submit"><i class="icofont icofont-search"></i>搜索
                                            </button>
                                            <button class="btn btn-warning btn-mini" type="button" id="resetBtn"><i class="icofont icofont-close"></i>重置</button>
                                            <g:link action="create" class="btn btn-info btn-mini">
                                                <i class="icofont icofont-plus"></i>新增
                                            </g:link>

                                        </div>
                                    </div>
                                </g:form>
 --}%
                                <table class="table table-striped  table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <g:sortableColumn property="serialNumber" title="序列号" />
                                            <g:sortableColumn property="name" title="公司" />
                                            <g:sortableColumn property="code" title="代码" />
                                            <g:sortableColumn property="industry" title="行业" />
                                            <g:sortableColumn property="maximumNumberOfAccount" title="最大客户数量" />
                                            <g:sortableColumn property="maximumNumberOfUser" title="最大用户数量" />
                                            <g:sortableColumn property="createdDate" title="创建时间" />
                                            <g:sortableColumn property="modifiedDate" title="修改时间" />
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <g:each in="${companyList}">
                                            <tr>
                                                <td>
                                                    <g:link action="show" id="${it.id}" class="firstTd">${it?.serialNumber}</g:link>
                                                </td>
                                                <td>${it?.name}</td>
                                                <td>${it.code}</td>
                                                <td>${it.industry?.name}</td>
                                                <td>${it.maximumNumberOfAccount}</td>
                                                <td>${it.maximumNumberOfUser}</td>
                                                <td>
                                                    <g:formatDate date="${it?.createdDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                                                </td>
                                                <td>
                                                    <g:formatDate date="${it?.modifiedDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                                                </td>
                                            </tr>
                                        </g:each>
                                    </tbody>
                                </table>

                                <div class="dataTables_paginate">
                                    <div class="pagination">
                                        <g:paginate total="${companyCount ?: 0}" params="${params}" />
                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>
                </div>
                <!-- Hover table card end -->
            </div>

            <!-- Page-body end -->
        </div>
    </div>
    <g:javascript>
        $(function () { $("#resetBtn").click(function () { $("#name").val(""); $("#code").val(""); $("#industry").val(""); }) });

    </g:javascript>
</body>

</html>
